home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / computerjanitor / plugins / langpack_manual_plugin.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  2.6 KB  |  54 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import computerjanitor
  5. _ = computerjanitor.setup_gettext()
  6. import logging
  7.  
  8. class ManualInstallCruft(computerjanitor.Cruft):
  9.     
  10.     def __init__(self, pkg):
  11.         self.pkg = pkg
  12.  
  13.     
  14.     def get_prefix(self):
  15.         return 'mark-manually-installed'
  16.  
  17.     
  18.     def get_shortname(self):
  19.         return self.pkg.name
  20.  
  21.     
  22.     def get_description(self):
  23.         return _('%s needs to be marked as manually installed.') % self.pkg.name
  24.  
  25.     
  26.     def cleanup(self):
  27.         self.pkg.markKeep()
  28.         self.pkg.markInstall()
  29.  
  30.  
  31.  
  32. class MarkLangpacksManuallyInstalledPlugin(computerjanitor.Plugin):
  33.     '''Plugin to mark language packs as manually installed.
  34.     
  35.     This works around quirks in the hardy->intrepid upgrade.
  36.  
  37.     '''
  38.     
  39.     def __init__(self):
  40.         self.condition = [
  41.             'from_hardyPostDistUpgradeCache']
  42.  
  43.     
  44.     def get_cruft(self):
  45.         cache = self.app.apt_cache
  46.         for pkg in cache:
  47.             if pkg.name.startswith('language-pack-') and not pkg.name.endswith('-base') and cache._depcache.IsAutoInstalled(pkg._pkg) and pkg.isInstalled:
  48.                 logging.debug("setting '%s' to manual installed" % pkg.name)
  49.                 yield ManualInstallCruft(pkg)
  50.                 continue
  51.         
  52.  
  53.  
  54.